﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CodeFirstRelationMapping.Models.Post>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ul class="posts">
        <% foreach (var item in Model)
           { %>
        <li class="post">
            <h3>
                <%: item.Title %>
            </h3>
            <div class="post-info">
                <span>
                    <%: item.CreatedBy %></span> - <span>
                        <%: String.Format("{0:g}", item.CreatedOn)%></span>
            </div>
            <p>
                <%: item.Body %>
            </p>
        </li>
        <% } %>
    </ul>
</asp:Content>
